<template>
    <el-table :data="tableData" border style="width: 100%; margin-top: 20px;">
      <el-table-column v-for="(header, index) in headers" :key="index" :prop="header" :label="header" width="180">
        <template #default="scope">
          <el-input v-model="scope.row[header]" />
        </template>
      </el-table-column>
    </el-table>
  </template>
  
  <script>
  import * as cache from '@/utils/cache';
  
  
  export default {
    name: 'ExcelPreview',
    props: {
        excelData: Array,
    },
    data() {
      return {
        tableData: this.excelData || [],
        headers: this.headers = Object.keys(this.tableData[0]) || [],
      };
    },
    methods: {
      loadFromLocalStorage() {
        const excelList = cache.get('excelList') || [];
        if (excelList.length > 0) {
          this.tableData = excelList[0];
          
        }
       
      }
    },
  };
  </script>
  
  <style scoped></style>